﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace PLCS.App.ConfigManager.Views.Config
{
    /// <summary>
    /// ConfigView.xaml 的交互逻辑
    /// </summary>
    public partial class ConfigView : UserControl
    {
        public ConfigView()
        {
            InitializeComponent();
        }

        private void Dg_LoadingRow(object sender, DataGridRowEventArgs e)
        {
            foreach (var item in dg.Items)
            {
                DataGridRow drg = (DataGridRow)dg.ItemContainerGenerator.ContainerFromItem(item);
                if (drg != null)
                    drg.Header = drg.GetIndex() + 1;
            }
        }

        private void dg_UnloadingRow(object sender, DataGridRowEventArgs e)
        {
            e.Row.Header = e.Row.GetIndex() + 1;
        }
    }
}